////////////////////////////////////////////////////////////////////////////////
//
//  People2 Creative Systems  
//  Copyright 2008 People2 Creative Systems
//
//	License GPL v2.0
//
////////////////////////////////////////////////////////////////////////////////

package com.people2.commons.base
{
	import com.people2.commons.autolistener.HandlerManager;
	import com.people2.commons.exception.OverrideException;
	
	import mx.containers.Box;
	import mx.events.FlexEvent;

	public class BaseBox extends Box
	{
		public function BaseBox(_direction:String="horizontal")
		{
			super();
			direction = _direction;
			addEventListeners();
		}
		
		private function addEventListeners():void
		{
			addEventListener(FlexEvent.CREATION_COMPLETE,doInit,false,0,true);
		}
		
		private function doInit(event:FlexEvent):void
		{
			HandlerManager.instance.autoListeners(this);
			creationComplete(event);
		}
		
		protected function creationComplete(evet:FlexEvent):void
		{
			throw new OverrideException("Override method creationComplete",1000); 
		}
		
	}
}